package com.hilinos.base.user.entity.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @author hilinos
 * @since 2022-03-11
 */
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
@ApiModel("三方key管理")
@TableName("key_info")
public class KeyInfoPoJo implements Cloneable, Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 正常使用
     */
    public static final int STATUS_USED = 1;

    /**
     * 停用
     */
    public static final int STATUS_STOP = 2;

    /**
     * 已过期
     */
    public static final int STATUS_EXPIRE = 3;

    /**
     * 已删除
     */
    public static final int STATUS_DELETE = 9;

    @ApiModelProperty("平台id")
    @TableId("key_appid")
    private String keyAppid;
    @ApiModelProperty("平台名称")
    @TableField("key_name")
    private String keyName;
    @ApiModelProperty("平台类型")
    @TableField("key_type")
    private String keyType;
    @ApiModelProperty("平台加密字符串")
    @TableField("key_secret")
    private String keySecret;

    @ApiModelProperty("平台过期时间，为空表示永不过期")
    @TableField("key_exp_time")
    private Date keyExpTime ;
    @ApiModelProperty("状态;1：正常使用 2：停用 3：已过期 9：删除")
    @TableField("key_status")
    private Integer keyStatus ;

    @ApiModelProperty("创建时间")
    @TableField("creator_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date creatorTime;
    @ApiModelProperty("更新时间")
    @TableField("updator_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatorTime;
}